import { $getdata } from "@/api/http";

// 获取所有流程数据
// http://172.18.66.66:8099/api/dip/rest/flow/all
export function getFlowAll() {
    return $getdata.get("/flow/all").then(({ data }) => data);
}

// 获取限制数据
// http://172.18.66.66:8099/api/dip/rest/flow?categoryId=&name=&page=0&size=40&flowState=&resourceId=
export function getFlowPartialData(params: any) {
    return $getdata.get("/flow", { params }).then(({ data }) => data);
}

// 获取流程类别
export function getFlowCategory() {
    return $getdata.get("/flowCategory/all").then(({ data }) => data);
}

// 获取流程标签
// http://172.18.66.66:8099/api/dip/rest/flow/labels
export function getFlowLabels() {
    return $getdata.get("/flow/labels").then(({ data }) => data);
}

// 资源
// http://172.18.66.66:8099/api/dip/rest/resources
export function getResources() {
    return $getdata.get("/resources").then(({ data }) => data);
}

// 删除
// http://172.18.66.66:8099/api/dip/rest/flow/4bb30618-4b3c-4e4e-a5b9-70531e9299bc
export function deleteFlowDate(id: string) {
    return $getdata.delete(`/flow/${id}`).then((res) => res);
}
